package model.daobase;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DBase {

    protected Connection conn;
//
//    protected void init_mysql() {
//        String className = "com.mysql.jdbc.Driver";
//        String url="jdbc:mysql://127.0.0.1:3306/baticuevavirtual";
//        String user="root";
//        String password ="root";
//        
//        try{
//            Class.forName(className);
//            conn= DriverManager.getConnection(url, user, password);
//            
//        
//        } catch(SQLException ex){
//            System.out.println("Parametros incorrectos");
//            ex.printStackTrace();
//        
//        } catch(ClassNotFoundException ex) {
//            ex.printStackTrace();
//            System.out.println("No existe el driver");
//        }
//        
//        
//        
//    }
    
    public void init_mysql() {
        String className = "com.mysql.jdbc.Driver";
        String user = "inf210";
        String pass = "baticuevavirtual";
        String url = "jdbc:mysql://aguilar-network.dlinkddns.com:6980/baticuevavirtual";
        try {
            Class.forName(className);
            conn = DriverManager.getConnection(url, user, pass);
        } catch (SQLException ex) {
            System.out.println("No pudo conectarse parametros incorrectos");
            ex.printStackTrace();
        } catch (ClassNotFoundException ex) {
            ex.printStackTrace();
            System.out.println("No existe el driver");
        }
    }
}
